﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Collections.Generic;


public partial class News_NewTypeList : System.Web.UI.Page
{
    protected void Page_PreInit(object sender, EventArgs e)
    {
        Page.Theme = BLL.Common.GetWSThemes();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            AspNetPager1.PageSize = 10;
            Init_title();
            Bind_typeList();
        }
    }
    private void Init_title()
    {
        if (Request.QueryString["typeid"] != null)
        {
            Model.NewType type = new Model.NewType();
            type = new BLL.NewType().GetModel(int.Parse(Request.QueryString["typeid"].ToString()));
            typename.Text = "-->" + type.NT_NAME;
            this.Page.Title = "资讯中心" + typename.Text + " " + BasePage.WebTitle;
        }
    }
    private void Bind_typeList()
    {
        if (Request.QueryString["typeid"] != null)
        {
            string where = "";
            where = " and NEW_ISDEL=0 and New_type=" + Request.QueryString["typeid"].ToString();
            int pagecount, count;
            BLL.NEWS bll_news = new BLL.NEWS();      
            
            Repeater1.DataSource = bll_news.GetList(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, "NEW_ORDER", false, where, out pagecount, out count);
            Repeater1.DataBind();
            AspNetPager1.RecordCount = count;
        }
    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        Bind_typeList();
    }
}
